package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.domain.Collect;
import com.ruoyi.system.domain.CollectDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CollectMapper extends BaseMapper<Collect> {

    //根据user_id查收藏列表
    List<CollectDto> getCollect(@Param("user_id") Integer user_id,
                                @Param("productId") Integer productId);

    //根据user_id,productId将商品移出收藏
    Integer deleteCollect(@Param("user_id") Integer user_id,
                          @Param("productId") Integer productId);

    Integer insertCollect(Collect collect);
}
